package com.hmall.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * RestHighLevelClient配置
 *
 * @Author 15198
 * @Date 2022/8/10 10:17
 * @Description: RestHighLevelClient配置
 * @Created by
 */
@Configuration
public class RestHighLevelClientConfig {


    @Bean
    public RestHighLevelClient myRestClient() {
        return new RestHighLevelClient(RestClient.builder(new HttpHost(EsConstant.ES_HOST, EsConstant.ES_PORT)));
    }

}
